package com.naiterui.ehp.bs.recommend.bean;

import lombok.Data;

import javax.persistence.*;
import java.util.Date;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * 药师用户表
 *
 * @author guoyongxiang
 * @date 2019-07-23 16:29
 * @since 1.0.0
 */
@Data
@Table(name = "recom_esign_pharmacist")
@Entity
public class RecomEsignPharmacist {

    /**
     * 用户状态-正常 {@value}
     */
    public static final Integer STATUS_NORMAL = 1;
    /**
     * 用户类型-自动审核用户 {@value}
     */
    public static final Integer TYPE_AUTO_AUDIT_USER = 0;
    /**
     * 用户类型-人工审核用户 {@value}
     */
    public static final Integer TYPE_NORMAL_USER = 1;

    /**
     * 处方审核权限级别-初审 {@value} (中级职称以下:药士、药师)
     */
    public static final Integer AUDIT_LEVEL_PRE = 0;
    /**
     * 处方审核权限级别-复审 {@value} (中级职称及以上:主管药师、副主任药师、主任药师)
     */
    public static final Integer AUDIT_LEVEL_FINAL = 1;

    /**
     * 用户认证状态-未认证
     */
    public static final Integer AUTH_STATUS_DEF = 0;
    /**
     * 用户认证状态-通过
     */
    public static final Integer AUTH_STATUS_PASS = 1;
    /**
     * 用户认证状态-不通过
     */
    public static final Integer AUTH_STATUS_NOT_PASS = 2;

    /**
     * 主键
     */
    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "id", unique = true, nullable = false)
    private Long id;

    /**
     * 药师ID
     */
    @Column(name = "pharmacist_id")
    private Long pharmacistId;

    /**
     * 三方用户id
     */
    @Column(name = "open_id")
    private String openId;

    /**
     * 用户姓名
     */
    @Column(name = "name")
    private String name;

    /**
     * 手机号
     */
    @Column(name = "phone")
    private String phone;

    /**
     * 身份证号
     */
    @Column(name = "id_card")
    private String idCard;

    /**
     * 用户类型-0:自动审核用户(含普通用户), 1:普通后台用户
     */
    @Column(name = "type")
    private Integer type;

    /**
     * 审核级别(初审：{@link #AUDIT_LEVEL_PRE}、复审：{@link #AUDIT_LEVEL_FINAL})
     */
    @Column(name = "audit_level")
    private Integer auditLevel;

    /**
     * 签章图片地址
     */
    @Column(name = "seal_image")
    private String sealImage;

    /**
     * 账户状态-0:停用, 1:正常
     */
    @Column(name = "status")
    private Integer status;

    /**
     * 用户认证状态(0:待审核, 1:通过, 2:不通过)
     */
    @Column(name = "auth_status")
    private Integer authStatus;

    /**
     * 密码盐
     */
    @Column(name = "salt")
    private String salt;

    /**
     * 加密密码
     */
    @Column(name = "encode_password")
    private String encodePassword;

    @Column(name = "reason")
    private String reason;

    /**
     * 签名密码
     */
    @Column(name = "auth_pwd")
    private String authPwd;

    /**
     * 是否免密 0.否 1.是
     */
    @Column(name = "no_secret")
    private Integer noSecret;

    /**
     * 创建时间
     */
    @Column(name = "created_at")
    private Date createdAt;

    /**
     * 创建人
     */
    @Column(name = "created_by")
    private String createdBy;

    /**
     * 修改时间
     */
    @Column(name = "changed_at")
    private Date changedAt;

    /**
     * 修改人
     */
    @Column(name = "changed_by")
    private String changedBy;

    /**
     * 乐观锁
     */
    @Version
    private Integer version;
}
